﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BusinessObjects.BusinessRules;

namespace BusinessObjects.Sales
{
    public class Receipt : BusinessObject
    {
        public Receipt()
        {
            AddRule(new ValidateRequired("RefID"));

            AddRule(new ValidateRequired("RestaurantID"));

            AddRule(new ValidateRequired("RefNo"));
            AddRule(new ValidateLength("RefNo", 0, 20));

            AddRule(new ValidateRequired("RestaurantTableID"));

            AddRule(new ValidateRequired("EmployeeID"));

            AddRule(new ValidateRequired("AccountingObjectID"));
        }

        public Receipt(string refId, string restaurantId, int refType, DateTime refDate, DateTime postedDate, string refNo, string employeeId,
                        string employeeName, string employeeAddress, string journalMemo, string currencyId, decimal exchangeRate, bool isPosted,
                        decimal totalAmount, decimal totalDiscountAmount, decimal totalVATAmount, bool isImportPurchase, string shippingMethodID)
            : this()
        {
            RefID = refId;
            RefType = refType;
            RefDate = refDate;
            PostedDate = postedDate;
            RefNo = refNo;
            EmployeeID = employeeId;
            EmployeeName = employeeName;
            EmployeeAddress = employeeAddress;
            JournalMemo = journalMemo;
            CurrencyID = currencyId;
            ExchangeRate = exchangeRate;
            IsImportPurchase = isImportPurchase;
            ShippingMethodID = shippingMethodID;
            TotalAmount = totalAmount;
            TotalVATAmount = totalVATAmount;
            RestaurantID = restaurantId;
            IsPosted = isPosted;
        }

        public string RefID { get; set; }

        public int RefType { get; set; }

        public DateTime RefDate { get; set; }

        public DateTime PostedDate { get; set; }

        public string RefNo { get; set; }

        public string EmployeeID { get; set; }

        public string EmployeeName { get; set; }

        public string EmployeeAddress { get; set; }

        public string JournalMemo { get; set; }

        public string CurrencyID { get; set; }

        public decimal ExchangeRate { get; set; }

        public bool IsImportPurchase { get; set; }

        public string ShippingMethodID { get; set; }

        public decimal TotalAmount { get; set; }

        public decimal TotalVATAmount { get; set; }

        public string RestaurantID { get; set; }

        public bool IsPosted { get; set; }
    }
}
